package app.demo.query;

import org.apache.commons.lang.StringUtils;
import org.springleaf.core.query.QueryObject;

public class UserQuery extends QueryObject {

	private Long id;
	private String userName;
	private String trueName;
	
	@Override
	public void customizeQuery() {
		if(StringUtils.isNotBlank(userName)){
			this.addQuery("userName", userName, "=");
		}
		
		if(StringUtils.isNotBlank(trueName)){
			this.addQuery("trueName", "%" + trueName + "%", "like");
		}
	}

	public Long getId() {
		return id;
	}

	public UserQuery setId(Long id) {
		this.id = id;
		return this;
	}

	public String getUserName() {
		return userName;
	}

	public UserQuery setUserName(String userName) {
		this.userName = userName;
		return this;
	}

	public String getTrueName() {
		return trueName;
	}

	public UserQuery setTrueName(String trueName) {
		this.trueName = trueName;
		return this;
	}

}
